<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>井石管理平台</title>

    <!-- Bootstrap core CSS -->
    <link href="/hcxy/server/Application/Admin/View//Public/static/css/bootstrap.css" rel="stylesheet">

    <!-- Add custom CSS here -->
    <link href="/hcxy/server/Application/Admin/View//Public/static/css/sb-admin.css" rel="stylesheet">
    <link rel="stylesheet" href="/hcxy/server/Application/Admin/View//Public/static/font-awesome/css/font-awesome.min.css">

        <!-- 导出引用 -->
    <link rel="stylesheet" type="text/css" href="/hcxy/server/Public/Ext/styles.css"/>
    <!-- <link rel="stylesheet" type="text/css" href="/hcxy/server/Public/Ext/bootstrap.css"/> -->
    <script type="text/javascript" src="/hcxy/server/Public/Ext/jquery.min.js"></script>
    <script type="text/javascript" src="/hcxy/server/Public/Ext/bootstrap.min.js"></script>


</head>
<style>
  p:hover{color:#ffffff;}
</style>

<body>

<div id="wrapper">

    <!-- Sidebar -->
    <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="<?php echo U('Ent/index');?>">井石管理平台</a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse navbar-ex1-collapse">

            <ul class="nav navbar-nav side-nav">
            <li class="dropdown">
                <a href="<?php echo U('Ent/index');?>"><i class="fa fa-reorder"></i> 数据列表</a>
            </li>
            <li class="dropdown addueditor">
                <a id="fa-edit" style="cursor:pointer"><i class="fa fa-edit"></i> 添加管理</a>
                <span id="disp"  style="color:#808080">
                    <p style="cursor:pointer"><i class="new" name=1></i> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + 添加新服</p>";
                    <p style="cursor:pointer"><i class="new" name=2></i> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + 首页图鉴</p>;
                    <p style="cursor:pointer"><i class="new" name=3></i> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + 添加新闻</p>;
                    <p style="cursor:pointer"><i class="new" name=4></i> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + 活动|攻略</p>;
                    <p style="cursor:pointer"><i class="new" name=5></i> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + 二维码</p>;
                    <p style="cursor:pointer"><i class="new" name=6></i> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + 礼品码</p>;
                    <p style="cursor:pointer"><i class="new" name=7></i> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + 轮播图</p>;
                </span>
            </li>
            <li class="dropdown">
                <a href="<?php echo U('Ent/upd');?>"><i class="fa fa-users"></i> 修改密码</a>  
             </li>

 </ul>

            <ul class="nav navbar-nav navbar-right navbar-user">

                <li class="dropdown user-dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-user"></i> 你好,<?php echo session('username');?> <b class="caret"></b></a>
                    <ul class="dropdown-menu">
                        <li class="divider"></li>
                        <li><a href="<?php echo U('login/logout');?>"><i class="fa fa-power-off"></i> 退出</a></li>
                    </ul>
                </li>
            </ul>
        </div><!-- /.navbar-collapse -->
    </nav>


    <!-- 编辑器 -->
   <script type="text/javascript" src="/hcxy/server/Public/ueditor/third-party/jquery-1.10.2.js"></script>
        <script type="text/javascript" src="/hcxy/server/Public/ueditor/ueditor.config.js"></script>
        <script type="text/javascript" src="/hcxy/server/Public/ueditor/ueditor.all.js"></script>
  
 <script type="text/javascript" charset="utf-8">
        window.UEDITOR_HOME_URL = "/hcxy/server/Public/ueditor/";
        window.onload=function(){
          window.UEDITOR_CONFIG.initialFrameHeight=250;//自由设置宽
          window.UEDITOR_CONFIG.initialFrameWidth=600;//自由设置高
          var ue = UE.getEditor('editor');
            UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;  
            UE.Editor.prototype.getActionUrl = function(action) {  
                if (action == 'uploadimage' || action == 'uploadfile') {  
                    var id = $('#carInfoId').val();  
                    return "<?php echo U('Ent/QiniuUp');?>";  
                } else {  
                    return this._bkGetActionUrl.call(this, action);  
                }  
            };
        }

</script>
<style>
.new{

    padding:2px;border:5px solid #111111;color:#FFFFFF;background:#111111;
}
.add{
    color:red;font-size:10px;text-align:center;font-size: 20px;margin-left:1%;margin-top: 10em;
}

</style>
<div id="page-wrapper">

    <div class="from-content">
        <div class="add"  id="add1">
            <form action="<?php echo U('Ent/addAdmin');?>" method='POST' enctype='multipart/form-data'>
                <label for="aa">新服名称</label>
                <input type="text" name="newname" class="form-control" style="margin-left:40%;margin-top:5em; width:20em">
                <button type="submit" class="btn-default1"  style="margin: 5em 0em 0em 0em;">添加</button>
            </form>
        </div>

         <div class="add"  id="add6" style="display:none;">
            <form action="<?php echo U('Ent/eximport');?>" method='POST' enctype='multipart/form-data'>
                <label for="aa">导入Excel礼品码</label>
                <input type="file" name="excel"  style="margin-left:42%;margin-top:5em; width:20em">
                <input type="submit" class="btn-default1"  style="margin: 5em 0em 0em 0em;" value="开始导入">
            </form>
        </div>
        <div class="add"  id="add2" style="display:none;">
            <form action="<?php echo U('Ent/uplode');?>" method='POST' enctype='multipart/form-data'>
                <label for="aa">添加图鉴图片</label>
                <input type="file" name="photo[]" multiple="multiple" style="margin-left:42%;margin-top:2em; width:20em"> <p style="font-size: 13px;color:red"><br>提示:第一张上传星级宠物图片,第二张上传星级宠物详情图片</p>
                <br><br>
                <label for="aa">选择星级</label>
                <select name="num" >
                  <option value ="1">1星</option>
                  <option value ="2">2星</option>
                  <option value="3">3星</option>
                  <option value="4">4星</option>
                </select>
                 <br><br><br>

                <button type="submit" class="btn-default2">上传</button>
            </form>
    
        </div>
        <div class="add"  id="add3" style="display:none;margin-top:3em;">
                
                    <label for="aa">新闻标题</label> <br>
                    <input type="text" name="title" class="form-control" style="margin-left:42%; width:20em">
                    <br>
                    <label for="aa">选择新闻状态</label>
                    <select name="num" >
                      <option value="1">最新</option>
                      <option value ="2">新闻</option>
                      <option value ="3">公告</option>
                    </select>
                     <br><br>
                     <label for="aa">新闻详情内容</label><br>
                    <textarea name="editor" id="editor"  runat="server" style="margin-left:30%;"></textarea>
                    <br>
                    <button class="btn-default2" onClick="uptext(this);" >提交</button>
              
        </div>
       <div class="add"  id="add4" style="display:none;margin-top:2em;">
                <form action="<?php echo U('Ent/uplode');?>" method='POST' enctype='multipart/form-data'>
                    <label for="aa">活动、攻略图片</label><br><br>
                    <input type="file" id="activity_img" name="activity_img" style="margin-left:42%; width:20em"> <p style="font-size: 13px;color:red"><br>提示:添加最新活动或者游戏攻略图片</p><br>
                    <label for="aa">活动、攻略简介标题</label> <br>
                    <input type="text" id="activity" name="title" class="form-control" style="margin-left:40%; width:20em">
                    <br>
                    <label for="aa">活动、攻略简介内容</label> <br>
                    <textarea type="text"  name="introduction" class="form-control" style="margin-left:35%; width:30em;height:10em;"></textarea>
                    <br>
                    <label for="aa">活动、攻略详情标题</label> <br>
                    <input type="text" id="activity" name="details" class="form-control" style="margin-left:40%; width:20em">
                    <br>
                    <label for="aa">选择状态</label>
                    <select name="sum" >
                      <option value="1">最新活动</option>
                      <option value ="2">游戏攻略</option>
                    </select>
                     <br><br>
                     <label for="aa">活动、攻略的详情内容</label><br>
                    <textarea name="editor" id="editorContact"  runat="server" style="margin-left:28%;"></textarea>
                    <br>
                    <button type="submit" class="btn-default2" >提交</button>
                </form>
        </div>
        <div class="add"  id="add5" style="display:none;">
            <form action="<?php echo U('Ent/uplode');?>" method='POST' enctype='multipart/form-data'>
                <label for="aa">添加首页二维码图片</label>
                <input type="file" name="photo"  style="margin-left:42%;margin-top:2em; width:20em"> <p style="font-size: 13px;color:red"><br>提示:首页下载软件二维码</p>
                <input type="text" name="image" value="type" style="display:none;">
                <br><br>
                <button type="submit" class="btn-default2">上传</button>
            </form>
    
        </div>
        <div class="add"  id="add7" style="display:none;">
            <form action="<?php echo U('Ent/rotation');?>" method='POST' enctype='multipart/form-data'>
                <label for="aa">添加轮播图</label>
                <input type="file" name="photo[]" multiple="multiple" style="margin-left:42%;margin-top:2em; width:20em"> <p style="font-size: 13px;color:red"><br>提示:首页轮播图</p>
                <br><br>
                <input type="submit" class="btn-default2" value="上传图片">
            </form>
    
        </div>
</div>
<!-- JavaScript -->
<script src="/hcxy/server/Application/Admin/View//Public/static/js/jquery-1.10.2.js"></script>
<script src="/hcxy/server/Application/Admin/View//Public/static/js/bootstrap.js"></script>
<script src="/hcxy/server/Application/Admin/View//Public/static/js/app.js"></script>

</body>
</html>

<script type="text/javascript">
//编辑器传参
 function uptext(obj){
            var ueditor='';
            var num='';
            var title='';
           ueditor = UE.getEditor('editor').getContent();
           title = $('#add3 input').val();
           num = $('#add3 select').val();
            $.ajax({
                url: "index.php?m=Admin&c=Ent&a=addAdmin",
                type: 'POST',
                data: {
                   'ueditor':ueditor,'num':num,'title':title,
                },
                dataType: "JSON",
                success: function (data) {
                    if(data.result==1){
                    alert(data.msg);
                    history.go(0)
                    }
                    if(data.result==0){
                        alert(data.msg);
                    }
                }
            });
        } 

</script>
 <script>
     $('#fa-edit').click(function(){
        $('#disp').toggle();
        $('#disp').css("color","#808080");
     })
     $('#disp p').click(function(){
        $('#disp p').css("color","#808080");
        $(this).css("color","#ffffff");
        $('.from-content .add').each(function(){
             $(this).hide();
        });

        var num = $(this).children('i').attr('name');
        if(num==1){
            $('#add1').show();
        }
         if(num==2){
            $('#add2').show();
        }
         if(num==3){
            $('#add3').show();
        }
         if(num==4){
             $('#add4').show();
             var ue = new UE.ui.Editor({} );
          var ueContact = new UE.ui.Editor({} );
          ue.render('editor');  
          ueContact.render('editorContact');   
        }
         if(num==5){
            $('#add5').show();
        }if(num==6){
            $('#add6').show();
        }
        if(num==7){
            $('#add7').show();
        }
        
     });

     $('.dropdown-toggle').click(function(){
      $('.dropdown-menu').show();

     })
 </script>